import { type RouteRecordRaw } from 'vue-router';

const Layout = () => import('@/layout/index.vue');

/**
 * 开发模式 功能展示模块 路由
 */
export const templateRoutes: RouteRecordRaw[] = [
  {
    path: '/template',
    name: 'Template',
    component: Layout,
    redirect: '/template/list-page',
    meta: {
      title: '模板页面',
      icon: 'system',
      hidden: false,
      alwaysShow: true,
      params: null,
    },
    children: [
      {
        path: 'list-page',
        name: 'TemplateList',
        component: () => import('@/views/template/list-page/list.vue'),
        meta: {
          title: '列表模板',
          icon: 'document',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'list-page-detail/:id',
        name: 'TemplateDetail',
        component: () => import('@/views/template/list-page/detail.vue'),
        meta: {
          title: '列表模板详情',
          icon: 'document',
          hidden: true,
          keepAlive: true,
          activeMenu: '/template/list-page',
        },
      },
      {
        path: 'dev-page',
        name: 'TemplateDev',
        component: () => import('@/views/template/dev-page/index.vue'),
        meta: {
          title: '开发模板',
          icon: 'api',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'app-page',
        name: 'TemplateApp',
        component: () => import('@/views/template/app-page/list.vue'),
        meta: {
          title: 'AppPage模板',
          icon: 'browser',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'app-page-detail/:id',
        name: 'TemplateAppDetail',
        component: () => import('@/views/template/app-page/edit-detail.vue'),
        meta: {
          title: 'AppPage模板详情',
          icon: 'browser',
          affix: false,
          keepAlive: true,
          hidden: true,
          activeMenu: '/template/app-page',
        },
      },
      {
        path: 'app-page-edit/:id',
        name: 'TemplateAppEdit',
        component: () => import('@/views/template/app-page/edit-detail.vue'),
        meta: {
          title: 'AppPage模板编辑',
          icon: 'browser',
          affix: false,
          keepAlive: true,
          hidden: true,
          activeMenu: '/template/app-page',
        },
      },
    ],
  },
];
